<#include "/layout/header.ftl" />
<#import "/include/ui.ftl" as blue />

	<script src="${rc_path}/js/jquery/jquery-crypto.js"></script>
<script>

$(function()
{
	
});

function save_click()
{
	$.simpleValid("#div_form", function(obj)
	{
		obj.pwd = $.sha1(obj.pwd);
		obj.password = $.sha1(obj.password);
		
		$.simpleAjax("/index/password", obj, function(o)
		{
			$.successAlert("修改密码成功");
			$("#div_form input[type=password]").val("");
		});
	});
}

</script>

<div class="am-form am-form-horizontal am-cf am-margin" id="div_form">

	<fieldset>
		<legend>修改密码</legend>
		
		<div class="am-u-md-8 am-u-md-offset-2">
			<div class="am-form-group">
				<label class="am-u-md-2 am-form-label am-padding-left-0 am-padding-right-0">旧密码</label>
				<div class="am-u-md-9 am-u-end">
					<input type="password" name="pwd" placeholder="输入旧密码" class="am-form-field am-radius"  maxlength="50" required />
				</div>
			</div>
		</div>
		
		<div class="am-u-md-8 am-u-md-offset-2">
			<div class="am-form-group">
				<label class="am-u-md-2 am-form-label am-padding-left-0 am-padding-right-0">新密码</label>
				<div class="am-u-md-9 am-u-end">
					<input type="password" id="txt_password" name="password" placeholder="输入新密码" class="am-form-field am-radius"
						maxlength="50" required />
				</div>
			</div>
		</div>
		
		<div class="am-u-md-8 am-u-md-offset-2">
			<div class="am-form-group">
				<label class="am-u-md-2 am-form-label am-padding-left-0 am-padding-right-0">确认密码</label>
				<div class="am-u-md-9 am-u-end">
					<input type="password" name="password2" placeholder="确认新密码" class="am-form-field am-radius"
						data-equal-to="#txt_password" data-validation-message="2次密码不一致" maxlength="50" required />
				</div>
			</div>
		</div>

		<div class="am-u-md-12 am-text-center div_btn">
			<a href="javascript:void(0)" onclick="save_click()" class="am-btn am-btn-primary am-radius">修改</a>
		</div>
	</fieldset>
</div>

<#include "/layout/footer.ftl" />